package models

import "encoding/json"

type User struct {
	Base
	Nickname string `json:"nickname"`
	Username string `json:"username"`
	Password string `json:"-"`
	Timestamp
}

func (*User) TableName() string {
	return "users"
}

func (u *User) MarshalBinary() ([]byte, error) {
	return json.Marshal(u)
}

func (u *User) UnmarshalBinary(data []byte) error {
	return json.Unmarshal(data, u)
}

type UserList struct {
	Base
	Nickname string `json:"nickname"`
	Username string `json:"username"`
	Timestamp
}
